package controle.gui.principal;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.sql.SQLException;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import org.jdesktop.swingx.JXLoginPane;

import controle.dao.LoginDao;
import controle.entidade.prinicipal.Login;

import javax.swing.JButton;


public class JfLogin extends JFrame {
	JXLoginPane loginPane ;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JfLogin frame = new JfLogin();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JfLogin() {
		initComponents();
	}
	public void initComponents(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 400, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
		
	    loginPane = new JXLoginPane();
		loginPane.setBounds(0, 0, 386, 181);
		
		panel.add(loginPane);
		
		JButton btnLogar = new JButton("Logar");
		btnLogar.setBounds(22, 216, 117, 24);
		panel.add(btnLogar);
		
		JButton btnCancear = new JButton("Cancear");
		btnCancear.setBounds(210, 216, 117, 24);
		panel.add(btnCancear);
		
		
	}
	public void logar() throws SQLException
	{
		String login = loginPane.getUserName();
		String senha = String.valueOf(loginPane.getPassword());
		
		LoginDao dao = new LoginDao();
		
		List<Login> n1 = dao.getLista(login, senha);
		  if(n1.equals(o))
		
			}
}
